using Gateway.Common.Entity;

namespace Gateway.Domain.Entities;

/// <summary>
/// 角色扩展权限
/// </summary>
public class RoleExtensionPermission : EntityBase
{
    public RoleExtensionPermission(string authType, string authKey = default, string authValue = default)
    {
        AuthType = authType;
        if (authType.Equals("dashboardmodule"))
        {
            AuthKey = "module";
        }
        else if (authType.Equals("dashboard"))
        {
            AuthKey = "dashboard";
        }
        else
            AuthKey = authKey;

        AuthValue = authValue;
    }

    public string RoleId { get; set; }
    /// <summary>
    /// 权限类型 数据权限   data   控制台模块 dashboardmodule  控制台  dashboard
    /// </summary>
    public string AuthType { get; set; }

    /// <summary>
    ///  扩展权限对应的key
    /// </summary>
    public string AuthKey { get; set; }

    /// <summary>
    /// 扩展权限对应的值
    /// </summary>
    public string AuthValue { get; set; }

    public RoleExtensionPermission()
    {
    }


    public Role  Role { get; set; }
}